package com.thread.window;

import com.thread.backer.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.provider.Settings;
import android.support.v4.widget.SimpleCursorAdapter.ViewBinder;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class MainActivity extends Activity implements View.OnClickListener {
	private Button but;
	private Button begin;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main);
		but = (Button) findViewById(R.id.button1);
		begin = (Button) findViewById(R.id.button2);

		but.setOnClickListener(this);
		begin.setOnClickListener(this);
	}

	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.button1:
			Intent intent = new Intent(MainActivity.this,
					FloatWindowService.class);
			startService(intent);
			finish();
			break;
		case R.id.button2:
			Intent killIntent = new Intent(
					Settings.ACTION_ACCESSIBILITY_SETTINGS);
			startActivity(killIntent);
			break;
		default:
			break;
		}

	}

}
